﻿/*
=============================================================================
Author:魏宝辉通过CodeSmithe生成
CreatedTime:2012-10-31
Description:Sms_Log三层结构数据访问层
=============================================================================
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using PWMIS.DataMap.Entity;
using FTchina.Models;//引入模型层
namespace FTchina.DAL
{
	public static partial class Sms_LogService
	{
		 
	 
			
		public static int DeleteSms_LogById(long id)	
		{     
            Sms_Log sms_Log = new Sms_Log();
            sms_Log.Id = id;
            EntityQuery<Sms_Log> query = new EntityQuery<Sms_Log>(sms_Log);
             return query.Delete(sms_Log);
		}	
        
          //以标识列获得对象
        public static Sms_Log GetSms_LogById(long  id)
        {
            Sms_Log sms_Log = new Sms_Log();
            sms_Log.Id = id;
            EntityQuery<Sms_Log> query = new EntityQuery<Sms_Log>(sms_Log);
            query.FillEntity(sms_Log);
            return sms_Log;
        }
		
	 
	 
       
        
        
        
		 
		 
		 public static int AddOrUpdateSms_Log(Sms_Log sms_Log)
        {
            Sms_Log _sms_Log = new Sms_Log();

            EntityQuery<Sms_Log> query = new EntityQuery<Sms_Log>(_sms_Log);
           _sms_Log= sms_Log;
           int i=(sms_Log.Id==0)?
                 query.Insert(_sms_Log): query.Update(_sms_Log);
            return i;
        }
		
		 
	}
}

